package cac.fenjian.resource.BZJReturn.service;

import cac.fenjian.resource.BZJReturn.dao.BZJReturnDao;
import com.cac.dme.adapter.rest.msg.QueryReqBean;
import com.cac.dme.adapter.rest.msg.QueryRespBean;
import com.cac.dme.adapter.utils.PageHelper;
import com.cac.dme.common.exception.service.DaoException;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * @className: BZJReturnService
 * @description: （描述这个类的作用）
 * @author:
 * @date: 2023/6/19 15:47:47 周一
 * @version: 1.0
 */
@Service
public class BZJReturnService {
    @Autowired
    private BZJReturnDao bzjReturnDao;



    //待接收标准件查询，条件查询
    public QueryRespBean<HashMap> searchReceivedBzj(QueryReqBean<HashMap> queryReqBean, String barcode, String bzjCodeType) {
        QueryRespBean<HashMap> queryRespBean = new QueryRespBean<>();
        try {
            PageHelper.startPage(queryReqBean.getPageParameter());
            HashMap searchParams = queryReqBean.getSearchParams();
            Page<HashMap> dataList = bzjReturnDao.searchReceivedBzj(searchParams,barcode,bzjCodeType);
            queryRespBean.setResult(dataList);
            return queryRespBean;
        } catch (Exception e) {
            e.printStackTrace();
            throw new DaoException(e.getMessage(), e);
        }
    }
}
